package service.temp.job;

import org.apache.commons.lang.StringUtils;
import service.Product;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class JudgeGate {


    public static void main(String[] args) {
        List<String> keywordList = loadRealCaseList("/Users/zhfan/Downloads/keywordList.txt");
        for (String keyword : keywordList) {
            if ("버버리".contains(keyword)) {
                System.out.println(" already match : " + keyword);
            }

        }
    }


    //    /Users/zhfan/Downloads/approved.csv
    public static List<String> loadRealCaseList(String fileName) {
        BufferedReader br = null;
        String line = "";
        List<String> candidateList = new ArrayList<>();

        try {
            br = new BufferedReader(new FileReader(fileName));
            while ((line = br.readLine()) != null) {
                if (StringUtils.isBlank(line)) continue;
                candidateList.add(line);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

        return candidateList;
    }
}
